<!--按name搜索-->
$("#nameSearchBtn").click(function(){
    var nameSearchVal= $("#nameSearchVal").val();
    if(nameSearchVal == null || $.trim(nameSearchVal) == "")
    {
        return;
    }
    var param = {
        name : nameSearchVal,
        type : "name",
        fbUrl : ""
    };
    $.ajax( {
        url : 'http://10.2.35.41:8080/fetchdata/data/fetch',
        type : 'POST',
        data : param,
        //dataType : 'json',
        //contentType:'application/json',
        //async : false,
        success : function(data) {
            console.log(data);
            //$("#searchTable tr").empty();  <img class="img-bordered" src="'+item.litImgUrl+'" alt="">
            $("#searchTable tr:not(:first)").empty();
            $('#nameSearchVal').val("");
            $("#child").empty();
            $.each(data.data, function(i, item){
                console.log(item);
                $('#searchTable').append('<tr>'+
                '<td style="text-align:center">'+item.name+'</td>'+
                '<td style="text-align:center">'+item.imageHash+'</td>'+
                '<td style="text-align:center">'+item.impressions+'</td>'+
                '<td style="text-align:center">'+item.clicks+'</td>'+
                '<td style="text-align:center">'+item.results+'</td>'+
                '<td style="text-align:center">'+item.spent+'</td>'+
                '</tr>');

                var table = '<table width="80%" style="margin:0 auto;" border="1" cellpadding="0" cellspacing="0">'+
                '<tr>'+
                '<th>adGroupId</th>'+
                '<th>day</th>'+
                '<th>imageHash</th>'+
                '<th>impression</th>'+
                '<th>click</th>'+
                '<th>result</th>'+
                '<th>spent</th>'+
                '</tr>';
                var child = _.sortBy(item.sumResultList,function (every) {return every.day;});
                    $.each(child, function(n, v) {
                        table += '<tr>'+
                        '<td>'+v.adGroupId+'</td>'+
                            '<td>'+v.day+'</td>'+
                            '<td>'+v.imageHash+'</td>'+
                        '<td>'+v.impressions+'</td>'+
                        '<td>'+v.clicks+'</td>'+
                        '<td>'+v.results+'</td>'+
                        '<td>'+v.spent+'</td>'+
                        '</tr>';
                    });

                $('#child').append(table);

            });
        },
        error : function() {
            alert("ajax error");
        }
    });
});

<!--按hashcode搜索-->
$("#hashSearchBtn").click(function(){
    var hashSearchVal= $("#hashSearchVal").val();
    if(hashSearchVal == null || $.trim(hashSearchVal) == "")
    {
        return;
    }
    var param = {
        name : hashSearchVal,
        type : "hash",
        fbUrl : ""
    };
    $.ajax( {
        url : 'http://10.2.35.41:8080/fetchdata/data/fetch',
        type : 'POST',
        data : param,
        //dataType : 'json',
        //contentType:'application/json',
        //async : false,
        success : function(data) {
            console.log(data);
            //$("#searchTable tr").empty();  <img class="img-bordered" src="'+item.litImgUrl+'" alt="">
            $("#searchTable tr:not(:first)").empty();
            $('#hashSearchVal').val("");
            $("#child").empty();
            $.each(data.data, function(i, item){
                console.log(item);
                $('#searchTable').append('<tr>'+
                    '<td style="text-align:center">'+item.name+'</td>'+
                    '<td style="text-align:center">'+item.imageHash+'</td>'+
                    '<td style="text-align:center">'+item.impressions+'</td>'+
                    '<td style="text-align:center">'+item.clicks+'</td>'+
                    '<td style="text-align:center">'+item.results+'</td>'+
                    '<td style="text-align:center">'+item.spent+'</td>'+
                    '</tr>');

                var table = '<table width="80%" style="margin:0 auto;" border="1" cellpadding="0" cellspacing="0">'+
                    '<tr>'+
                    '<th>adGroupId</th>'+
                    '<th>day</th>'+
                    '<th>imageHash</th>'+
                    '<th>impression</th>'+
                    '<th>click</th>'+
                    '<th>result</th>'+
                    '<th>spent</th>'+
                    '</tr>';
                var child = _.sortBy(item.sumResultList,function (every) {return every.day;});
                $.each(child, function(n, v) {
                    table += '<tr>'+
                        '<td>'+v.adGroupId+'</td>'+
                        '<td>'+v.day+'</td>'+
                        '<td>'+v.imageHash+'</td>'+
                        '<td>'+v.impressions+'</td>'+
                        '<td>'+v.clicks+'</td>'+
                        '<td>'+v.results+'</td>'+
                        '<td>'+v.spent+'</td>'+
                        '</tr>';
                });

                $('#child').append(table);

            });
        },
        error : function() {
            alert("ajax error");
        }
    });
});